package deltax.common.localize
{
    import deltax.common.*;
    import flash.utils.*;

    public class LocalizedFileMap extends Object
    {
        public static var loaded:Boolean;
        private static var m_fileUrlToLanguageMap:Dictionary = new Dictionary();

        public function LocalizedFileMap()
        {
            return;
        }// end function

        public static function load(param1:XML) : void
        {
            var _loc_2:XML = null;
            var _loc_3:String = null;
            var _loc_4:XML = null;
            DictionaryUtil.clearDictionary(m_fileUrlToLanguageMap);
            for each (_loc_2 in param1.lan)
            {
                
                _loc_3 = _loc_2.@name;
                for each (_loc_4 in _loc_2.file)
                {
                    
                    m_fileUrlToLanguageMap[_loc_4.toString().toLowerCase()] = _loc_3;
                }
            }
            loaded = true;
            return;
        }// end function

        public static function getFileLanguageDir(param1:String) : String
        {
            var _loc_2:* = m_fileUrlToLanguageMap[param1];
            if (!_loc_2)
            {
                return Language.CN;
            }
            return _loc_2;
        }// end function

    }
}
